package utils;

import java.awt.Component;
import java.awt.GridBagConstraints;

import javax.swing.JPanel;

public class Uteis {
	public static GridBagConstraints gbc = new GridBagConstraints();

	public Uteis() {
		gbc.fill = GridBagConstraints.NONE;
		gbc.anchor = GridBagConstraints.NONE;
		gbc.gridwidth = 1;
		gbc.gridheight = 1;
	}
	
	public static void addToPanel(JPanel panel, Component component,
			int column, int line) {
		gbc.gridx = column;
		gbc.gridy = line;
		panel.add(component, gbc);
	}

	public static void validaInt(String campo) throws NumberFormatException {
		Integer.parseInt(campo);
	}

	public static void validaFloat(String campo) throws NumberFormatException {
		Float.parseFloat(campo);
	}

	public static void validaCpf(String campo) {

	}

	public static void none() {
		gbc.fill = GridBagConstraints.NONE;
		gbc.anchor = GridBagConstraints.EAST;
		gbc.gridwidth = 1;
		gbc.gridheight = 1;

	
	}
}
